﻿using System.IO;
using System;
using System.Collections.Generic;

using System.Text;

namespace xReplace
{
    class LoadCommand : AbstractProcessingCommand
    {
        public LoadCommand(ref Content pipes)
            : base(ref pipes)
        { }

        public override bool ProcessCommand(System.Xml.XmlNodeList param)
        {
            string fromlabel = this.GetNodeValue("fromlabel", param);
            string tolabel = this.GetNodeValue("tolabel", param);
            if (tolabel == "") 
                this.contentPipelines.DefaultContent = this.contentPipelines.LoadContent(fromlabel);
            else
                this.contentPipelines.StoreContent(tolabel,this.contentPipelines.LoadContent(fromlabel));
            return true;
        }
    }
}
